from __future__ import print_function
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import NumericProperty
from kivy.uix.boxlayout import BoxLayout

from goblinoid.comments.commentmodal import CommentModal

Builder.load_file('goblinoid/feed/kv/activitybuttons.kv')


class ActivityButtons(BoxLayout):
    index = NumericProperty()

    def open_comment_modal(self):
        activity = self.get_activity()
        comment_modal = CommentModal(activity)
        comment_modal.open()

    def get_activity(self):
        return App.get_running_app().pump_service.inbox[self.index]
